home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000084_icon-group-sender _Fri Nov 13 12:27:32 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Fri, 13 Nov 1992 11:31:46 MST
  2. Date: Fri, 13 Nov 92 12:27:32 EST
  3. From: Paul_Abrahams@MTS.cc.Wayne.edu
  4. To: icon-group@cs.arizona.edu
  5. Message-Id: <527005@MTS.cc.Wayne.edu>
  6. Subject: Second argument to sortf
  7. Status: R
  8. Errors-To: icon-group-errors@cs.arizona.edu
  9.  
  10. Greg Townsend has told us that he just didn't think of the possibility
  11. of using a field name as the second argument to sortf when he built it.
  12. Given that it's too late to redo the design, what's the best way to provide
  13. this obviously useful functionality?
  14.  
  15. (1) Perhaps the implementation could be modified, as Jerry Nowlin suggested,
  16. to overload the second argument so that a field name would be interpreted
  17. as the key field.
  18.  
  19. (2) But an even neater approach, which wouldn't require modifying sortf at
  20. all, would be an Icon function fieldpos(rectype, fld) that would take a
  21. record type and field name as inputs and would yield the field position
  22. as output.  Such a function would probably have other uses as well.
  23.  
  24. Paul Abrahams
  25.  
  26.